package service;


import model.User;
import model.Users;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {


    @Autowired
    private dao.UserService1 userService1;
    @Autowired
    private Users users;
    public int countUser(String userName){
        int totalcount=userService1.countUser(userName);
        return totalcount;
    }
    public List<Users> findUser(User user){
           List<Users> users2=userService1.userByName(user);
        return users2;
    }
    public int delUser(String id){
        int del=userService1.delUser(id);
        return del;
    }
    public Users userById(String id){
        users=userService1.userById(id);
        return users;
    }
    public int saveUser(Users users){

        int save=userService1.saveUser(users);
        return save;
    }
    public int updataUser(Users users){
        int upd=userService1.updateUser(users);
        return upd;
    }
}
